package com.frame.work.common.aop.auth;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author wjming
 * @ClassName: GlobalExceptionErrorHandler
 * @Description:验证异常
 * @Date 2019/11/17 11:44
 */
@RestControllerAdvice
@Slf4j
public class GlobalExceptionErrorHandler {
//    @ExceptionHandler(SecurityException.class)
//    public ResponseEntity<CtrlResult> error(SecurityException e) {
//        log.warn("发生SecurityException异常", e);
//        return new ResponseEntity<CtrlResult>(
//                CtrlResult.builder()
//                        .msg(e.getMessage())
//                        .msgCode(StatusCode.TOKEN_EXPIRET)
//                        .success(false)
//                        .build(),
//                HttpStatus.UNAUTHORIZED
//        );
//    }
}

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
class ErrorBody {
    private String body;
    private int status;
}
